import serves from './axios'
import store from '@/store/index'

// baner图

// 获取baner图列表
export function getBannerList() {
    return serves({
        url: '/admin/getBannerList',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}

// 新增banner图
export function addbaner(data) {
    return serves({
        url: '/admin/addBanner',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 删除banner图
export function delBanner(id) {
    return serves({
        url: '/admin/delBanner',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 修改banner图
export function updateBanner(data) {
    return serves({
        url: '/admin/updateBanner',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 获取banner图详情
export function getBannerInfo(id) {
    return serves({
        url: '/admin/getBannerInfo',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}